package cn.alise.consts;

import java.util.HashMap;
import java.util.Map;


/**
 * 网站中的一些静态常量
 */
public class BaseConsts {
	
	/**
	 * 用来保存登录用户相关的一些静态常量
	 */
	public interface IUser {
		
		// 在session中单独存放
		public static final String USER_NAME = "username";
		public static final String ORGAN_NAME = "organname";
		public static final String USER_TYPE = "usertype";
		public static final String USER_ID = "userid";
		public static final String ACCOUNT = "account";
		public static final String ROLE_NAME = "rolename";
		public static final String USER_PATH = "userpath";
		
		// session中保存会话用到的key
		public static final String USER_SESSION_KEY = "user_info_key";
		
		// 验证码key
		public static final String VERIFICAN_CODE_KEY = "verification_code_key";
		
		public static final String USER_REGISTER_KEY = "user_register_key";
		
		// 菜单Menu
		public static final String MENU = "menu";
		
		// session进度条控制
		public static final String EXPORT_PROGRESS_TOTAL = "export_progress_total";
		public static final String EXPORT_PROGRESS_VALUE = "export_progress_value";
		
		// session导入进度条控制
		public static final String IMPORT_PROGRESS_TOTAL = "import_progress_total";
		public static final String IMPORT_PROGRESS_VALUE = "import_progress_value";
		public static final String IMPORT_SUCCESS_NUM = "import_success_num";
		public static final String IMPORT_FAIL_NUM = "import_fail_num";
		
	}
	
	/**
	 * Redis-key值
	 */
	public interface Redis {
		
		// 间隔符
		public static final String SIGN = "@#@";
		
		// token
		public static final String TOKEN = "token";
		
		// 会员信息
		public static final String WXUSERINFO = "wxuserInfo";
		
	}

	/**
	 * 用来保存发生错误和异常跳转到错误页面相关的一些静态常量
	 */
	public interface Error {
		
		//错误页面
		public static final String ERROR_PAGE = "pages/error/error";
		
		//异常页面
		public static final String EXCEPTION_PAGE = "pages/error/exception";
	}
	
	/**
	 * 正则表达式-验证版本号(0.0.0.000)
	 */
	public interface Pattern {
		
		/**
		 * 版本号验证
		 */
		public static final String VERSIONNO_REG = "^[1-9]{1}.[0-9]{1}.[0-9]{1}.[0-9]{3}$";
		
		/**
		 * 手机号码正则表达式
		 */
		public static final String mobile = "^1\\d{10}$";
		
		/**
		 * 身份证号正则表达式
		 */
		public static final String cardNo = "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$";
		
		/**
		 * 邮箱正则表达式
		 */
		public static final String email = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
		
		/**
		 * 正整表达式
		 */
		public static final String num =  "^[0-9]*[1-9][0-9]*$";
	}
	
	/**
	 * 导入文件路径
	 */
	public interface Import {
		/**
		 * 导入图片路径1
		 */
		public static final String imgPath1 =  "0";
		/**
		 * 导入图片路径2
		 */
		public static final String imgPath2 =  "/img/0/";
	}
	
	/**
	 * 车辆类型
	 */
	public interface vehicleType {
	
		public static final Map<String, String> vehicleTypeMap =  new HashMap<String, String>() {
			
			private static final long serialVersionUID = 7638656242504432756L;

			{
				put("01", "大型汽车");
				put("02", "小型汽车");
				put("03", "使馆汽车");
				put("04", "领馆汽车");
				put("05", "境外汽车");
				put("06", "外籍汽车");
				put("07", "普通摩托车");
				put("08", "轻便摩托车");
				put("09", "使馆摩托车");
				put("10", "领馆摩托车");
				put("11", "境外摩托车");
				put("12", "外籍摩托车");
				put("13", "低速车");
				put("14", "拖拉机");
				put("15", "挂车");
				put("16", "教练汽车");
				put("17", "教练摩托车");
				put("20", "临时入境汽车");
				put("21", "临时入境摩托车");
				put("22", "临时行驶车");
				put("23", "警用汽车");
				put("24", "警用摩托");
				put("51", "新能源大型车");
				put("52", "警用摩托");
			}
		};
		
	}
}
